﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using MinhTuan;
namespace Products
{
    public class OrderImport
    {
        private Int32 _Order_Id;
        private DateTime _Order_Date;
        private Int32 _Supply_Id;
        private String _People_Name;
        private Int32 _Quantity;
        private Decimal _Toltal;
        private String _Notice;
        private List<SelectedProduct> _Items;

        public List<SelectedProduct> Item
        {
            get { return _Items; }
            set { _Items = value; }
        }
        public OrderImport()
        {

        }
        public OrderImport(
            Int32 Order_Id,
            DateTime Order_Date,
            Int32 Supply_Id,
            String People_Name,
            Int32 Quantity,
            Int32 Toltal,
            String Notice
            )
        {
            _Order_Id = Order_Id;
            _Order_Date = Order_Date;
            _Supply_Id = Supply_Id;
            _People_Name = People_Name;
            _Quantity = Quantity;
            _Toltal = Toltal;
            _Notice = Notice;
        }

        public Int32 Order_Id
        {
            get { return _Order_Id; }
            set { _Order_Id = value; }
        }

        public DateTime Order_Date
        {
            get { return _Order_Date; }
            set { _Order_Date = value; }
        }

        public Int32 Supply_Id
        {
            get { return _Supply_Id; }
            set { _Supply_Id = value; }
        }

        public String People_Name
        {
            get { return _People_Name; }
            set { _People_Name = value; }
        }

        public Int32 Quantity
        {
            get
            {
                int tempResult = 0;
                foreach (SelectedProduct myCartItem in Item)
                {
                    tempResult += myCartItem.Quantity;
                }
                return tempResult;
            }
        }

        public Decimal Toltal
        {
            get
            {
                Decimal tempResult = 0;
                foreach (SelectedProduct myCartItem in Item)
                {
                    tempResult += myCartItem.Quantity * myCartItem.Price;
                }
                return tempResult;
            }
        }

        public String Notice
        {
            get { return _Notice; }
            set { _Notice = value; }
        }
        
    }

}
